home *** CD-ROM | disk | FTP | other *** search
/ Aminet 23 / Aminet 23 (1998)(GTI - Schatztruhe)[!][Feb 1998].iso / Aminet / disk / misc / AllowBad.lha / AllowBad.doc < prev    next >
Text File  |  1997-11-08  |  15KB  |  308 lines

  1.                                 AllowBad 1.0
  2.  
  3.                    c Mikolaj Calusinski 1996-97. Freeware.
  4.  
  5.                                  User Manual
  6.  
  7. Introduction
  8. ------------
  9. AllowBad  is  freeware (see 'Distribution') and copyright 1996-1997 by Mikolaj
  10. Calusinski. All rights reserved.
  11.  
  12. *****************************************************************************
  13. IMPORTANT!
  14.  
  15. IF YOU ARE A FASCIST OR NAZI YOU ARE *NOT* ALLOWED TO USE THIS PROGRAM!!!
  16. *****************************************************************************
  17.  
  18. Distribution
  19. ------------
  20.  
  21. [The  following text has been derived and adjusted from 'FileMaster 3.0.guide'
  22. c Toni Wilen 1995 (I don't want to reinvent the wheel). I hope Toni, you don't
  23. mind.]
  24.  
  25. AllowBad may be distributed freely, providing the following criteria are met:
  26.  
  27.  - None of the files in the AllowBad distribution archive may be modified or
  28.    omitted.
  29.  
  30.  - No money is charged for it apart from media and small handling fee.
  31.  
  32.  - AllowBad may be included in freely distributable software libraries,
  33.    including the Fred Fish collection and CD-ROM distributions of the Aminet
  34.    FTP site contents.
  35.  
  36.  - AllowBad may not be bundled with any commercial hardware or software
  37.    product without prior written consent from the author.
  38.  
  39.  - You may not reverse-engineer or modify the AllowBad executable on disk or
  40.    on memory except for compressing it.
  41.  
  42. Disclaimer
  43. ----------
  44.  
  45. [The  following text has been derived from 'FileMaster 3.0.guide' c Toni Wilen
  46. 1995 (I don't want to reinvent the wheel). I hope Toni, you don't mind.]
  47.  
  48. THIS  PRODUCT  IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ALL RISKS AND
  49. DAMAGES,  INCIDENTAL  OR OTHERWISE, ARISING FROM THE USE, MISUSE, OR INABILITY
  50. TO  USE  THIS  PROGRAM ARE ENTIRELY THE RESPONSIBILITY OF THE USER. THE AUTHOR
  51. DOES  NOT  MAKE  ANY  GUARANTEES OR REPRESENTATIONS REGARDING THE CORRECTNESS,
  52. RELIABILITY,  ACCURACY, CURRENTNESS, ETC. OF THIS PROGRAM. THE AUTHOR WILL NOT
  53. ACCEPT RESPONSIBILITY FOR ANY DAMAGE OR LOSSES RESULTING FROM THE USE, MISUSE,
  54. OR INABILITY TO USE THIS PRODUCT.
  55.  
  56.  
  57. What is that for?
  58. -----------------
  59.  
  60. This  program  was written as a replacement for good, but old BFormat 4.0. Its
  61. purpose  is  to  format  disks  of any *floppy-based* devices, which have hard
  62. (media)  error on them. Such disks cannot be formatted (and hence utilized) by
  63. system  'Format',  so  only  thing  you  could  do  was  getting  rid of them.
  64. Optionally, you could use BFormat of course, but such prepared disks were very
  65. unstable  under  AmigaDOS,  and gave 'read-write' errors quite often. This was
  66. because  of  way BFormat works - it allocates only blocks which appeared to be
  67. corrupted,  leaving  rest  of the track for use by filesystem. It sounds quite
  68. logical  and  give you more free space on disk but doesn't work that well with
  69. floppies.  For  safety  of  stored  data  it  is  better  to avoid whole track
  70. regardless whether there is only one or more bad blocks on it. That is the way
  71. AllowBad handles the errors - it masks the tracks, not blocks.
  72.  
  73. AllowBad should be able to format disks in all floppy-like devices, which have
  74. the following parameters (and these are checked when device type is determined
  75. to be floppy or not):
  76.  
  77. - number of surfaces must be 2
  78.  
  79. - starting cylinder (LowCyl) *must* be 0
  80.  
  81. - ending cylinder (HighCyl) must not be higher than 81
  82.  
  83. - block per track must be in range from 5 to 32
  84.  
  85. - block size must be standard (512 bytes)
  86.  
  87. - device must use AmigaDOS filesystem (0x444F53XX - 'DOS')
  88.  
  89. - max unit number is 3 (ranging from 0 to 3)
  90.  
  91. The  above  should  rule  out  all  harddisks  (if  you want to format damaged
  92. harddisk  use  BFormat  or  Quarterback), CDROMs, etc. AllowBad works (and has
  93. been  tested)  with  trackdisk  (DFx:),  diskspare  [(c)  1992-1994  by  Klaus
  94. Deppisch]  (DSx:) and floppy [(c) 1994-97 Orhan Dagistanli] (FSx:) devices. It
  95. should  support  all  possible  future  devices  which  comply  to  the  specs
  96. mentioned.
  97.  
  98. As  of  version  0.8  support  for  floppy.device  has  been  added.  This  is
  99. non-standard  device  as  it patches private structures of filesystem to place
  100. root  block  (and  other  special blocks) at track 0. This speeds up directory
  101. reading a bit, but is generally incompatible with AmigaDOS.
  102.  
  103. As  of  AllowBad  version 1.0 abovementioned special support for floopy.device
  104. has  been  removed, since version 4.1 of this device seems to follow standards
  105. more  closely. So, when You are going to format disks using floppy device with
  106. AllowBad,  beware  of the fact and install at least version 4.1 (or higher) of
  107. the device!
  108.  
  109. The  program  is aware of high density (HD) floppies and supports them, but be
  110. warned  that  only  standard  150RPM  drives  has  been  tested. If your drive
  111. requires special commands (and/or patches) to operate in HD mode, AllowBad may
  112. not  work  properly  (especially  with  3rd party devices such as diskspare or
  113. floppy).
  114.  
  115. You  can  format  RAD:  device  with AllowBad (as long as it complies to above
  116. specs) but this does not make much sense.
  117.  
  118. Requirements
  119. ------------
  120.  
  121. As  most  of  nowadays  programs,  AllowBad  requires  at  least  version 2.04
  122. of operating  system.  Reasons  are  obvious: it is much easier for programmer
  123. (me) to  code the whole thing and most Amiga users have already upgraded their
  124. systems  anyway.  If  you  want  to use DIRCACHE filesystem you need OS 3.0 or
  125. higher (however AllowBad can format dircache disks under 2.04, too).
  126.  
  127. AllowBad  also  requires  some  free memory; its amount depends on device. For
  128. further details see 'Way of operation' section.
  129.  
  130. Limitations
  131. -----------
  132.  
  133. AllowBad  is  somehow  a  little  bit  more  tollerant  than other programs of
  134. its kind  -  it  can  properly format and initialize disks, which have track 0
  135. (boot) damaged!   The   only   requirement  for  such  disks  is  the  ability
  136. to read/write  first  two  block  on  track  0  (ie. bootblocks) and one block
  137. on middle  track  of  disk  (ie.  rootblock).  So, if you have for example the
  138. disk which  has  damaged  only block number 3, there is a good chance AllowBad
  139. will be  able  to  initialize this disk and make it available for file storage
  140. (with low  side  of  track  0  allocated  as  bad).  But remember: such a disk
  141. is extremely  vulnerable  and  unstable.  Be  sure  not to store any important
  142. files on it!
  143.  
  144. In  previous  version  (0.5ß) AllowBad also was able to initialize disks which
  145. had  the  root  track  corrupted.  Unfortunately,  current version of AmigaDOS
  146. cannot  write to tracks which contain corrupted blocks (it can read from them,
  147. however),  so  such  disks most propably would be of no use anyway. In current
  148. version  the  disk  must  have  whole  root track not corrupted to be properly
  149. initialized.
  150.  
  151. This  version  of  AllowBad  is meant as a CLI command and cannot be used from
  152. Workbench (it has no GUI, so no pain I think).
  153.  
  154. Usage
  155. -----
  156.  
  157. Standard template (can be obtained via use of question mark) looks like this:
  158.  
  159. DRIVE/K/A,NAME/K,OFS/S,INTL=INTERNATIONAL/S,DIRCACHE/S:
  160.  
  161. As  you  can  see  only  one parameter must be specified - drive name. This is
  162. standard  doslevel device name such as 'df0:', 'ds1:', etc., case insensitive.
  163. Must  end with colon. Name of the disk must not exceed 30 chars (this limit is
  164. imposed  by  current  version  of  AmigaDOS). Names longer than permitted will
  165. simply  be truncated. If you want the filename to contain spaces, you must use
  166. quotes. As of version 1.0 the name parameter is optional - if omitted, default
  167. names  will  be  used: 'WARNING' (if there were errors on disk) or 'Empty' (on
  168. error free disks). Remaining two parameters (also optional) pertain to type of
  169. filesystem   used   while   initializing   the   disk.   INTL  (equivalent  to
  170. INTERNATIONAL)  denotes  INTL  FFS  (DOS3)  and  DIRCACHE  -  DC  FFS  (DOS5),
  171. respectively.  If  you use both of them at the same time DIRCACHE will be used
  172. (DC  implies  INTL  anyway). When none of switches is present the disk will be
  173. formatted with default normal FFS (DOS1).
  174.  
  175. Use  OFS switch to format disks with OldFileSystem (1.3 Kickstart compatible).
  176. But be warned, that 1.3 DOS ignores all protection bits except 'd' (deletable)
  177. and  you  can  access  the  faked dummy.file accidentally, causing 'Read/Write
  178. Error'  requester to appear. So, don't be surprised when this happens and take
  179. some care when using disks prepared by AllowBad under Kickstart 1.3.
  180.  
  181. While  formatting,  the program can be interrupted with CTRL-c. If this is so,
  182. execution  is  terminated  with  RC  (return code) set to 5 (WARN) and message
  183. '***BREAK' is printed.
  184.  
  185. Way of Operation
  186. ----------------
  187.  
  188. At  start  AllowBad  checks  whether the parameters issued by user are correct
  189. (they are  obtained through  standard  ReadArgs() function). At this analizing
  190. stage,  availability  of  disk  unit is also confirmed. If disk is not in use,
  191. AllowBad  immediately allocates it (by Inhibit() function). Else program quits
  192. with  error  message  'AllowBad failure: object is in use'. Unfortunately some
  193. programs  (such  as  great disk editor DPU 1.5 or recovery utility Quarterback
  194. Tools  2.2)  ignore  the  fact that the drive is inhibited by someone else and
  195. allow  you to work with such a drive.  This could lead to interference between
  196. those  programs  and  AllowBad, resulting in incorrectly formatted/initialized
  197. disks.  This is NOT my fault, but programmers of those utilities! My advice is
  198. not to use any disk utility while AllowBad executes.
  199.  
  200. If  everything  went  okay  (and  there  is a write-enabled disk in drive) one
  201. memory  buffer is allocated - its size is three times one track (calculated as
  202. follows:   3*BlocksPerTrack*512)  plus  82  bytes.  Thus  currently  the  most
  203. 'memory-hungry'  situation  I  can  think  of  will be HD disk formatted using
  204. floppy.device  [(c) 1994-97 Orhan Dagistanli]. In this case AllowBad will need
  205. 3*25*512+82  (=  38482)  bytes  of  free  memory. The kind of allocated memory
  206. (chip,  public, etc.) depends of flags parameter in device's FileSysStartupMsg
  207. (you can specify it in BufMemType parameter in mountlist).
  208.  
  209. Because  Allowbad  is  system  friendly,  it  uses  standard  device calls for
  210. accessing  the  disk  (via  IORequest). First, each track of disk is formatted
  211. (using  command  #11 - FORMAT) with special data pattern. Then (after flushing
  212. device  buffers for reliability) contents of this track is read back from disk
  213. and  compared with pattern data. If operation is successful, the same track is
  214. written with zeros and once again verified. During all of this program informs
  215. briefly  about  what  is  going  on. Each error encountered is notified in the
  216. second  buffer  and  the  appropriate  message  is diplayed. Each track can be
  217. accessed  up  to  four  times,  so  AllowBad  undoubtedly  is  not the fastest
  218. formatter  around.  But when dealing with corrupted media, reliability is what
  219. counts, not time.
  220.  
  221. When  formatting  completes,  AllowBad attempts to initialize the disk - first
  222. boot  blocks  are  written  (and  verified) then so is root. If above could be
  223. done,  disk state info (as obtained during format stage) is analysed and place
  224. for  other control blocks is determined. These blocks include: - dircache info
  225. block (if DIRCACHE switch was specified), bitmap block(s), file info block and
  226. eventually  some  file  extension  blocks.  The last two can be needed only if
  227. there were errors detected.
  228.  
  229. AllowBad  masks  corrupted areas using dummy file which pretends to occupy all
  230. the  bad  tracks.  This keeps the AmigaDOS filesystems from using those places
  231. and  you  can store files the same way as on good (error free) disks. To avoid
  232. confusion  the  file  is  protected from reading, updating, deleting, etc. and
  233. should  remain as such (don't play with this file - it IS completely faked and
  234. does not contain anything intreresting!) The name of the file is 'dummy.bad'.
  235.  
  236. Because of way AllowBad works (and I can't think of anything better, can you?)
  237. disks  prepared  by  it  can  *only*  be  used  under DOS, even that with some
  238. limitations.  Don't  try to diskcopy to such a disk! Use DOS command 'copy' or
  239. any  file managing program instead. Also, don't try to optimize bad disks with
  240. Reorg  or  like.  If  you  want  fast  directory listings use dircache (OS 3.0
  241. rules!)  And  remember that AllowBad DOES NOT repair anything - it only allows
  242. bad disks to be used while they actually still remain bad!
  243.  
  244. On  completion AllowBad informs you about number of blocks allocated (this not
  245. includes boot, root, DC, bitmap and FIB blocks).
  246.  
  247. Bugs
  248. ----
  249.  
  250. During  my  tests (well, not very intensive) no bugs were detected, which does
  251. not  mean  there  aren't  any.  If  you  find  any error or have some ideas of
  252. improvement  (or  if you simply wanna chat a little, receive the source, etc.)
  253. please contact me!
  254.  
  255. WARNING!
  256. When  using  AllowBad with floppy.device take extreme care - this device seems
  257. to  be  rather  unstable  hack  and  ocasionally  gives some wild errors while
  258. formatting, such like: no disk in drive. I thought this is a bug in my program
  259. but  everything  seems  to be ok and this weird behaviour only applies to this
  260. particular  device. If you find similiar errors happening with others devices,
  261. please contact me immediately (I will soon be available via email).
  262.  
  263. History
  264. -------
  265.  
  266. V0.5ß - (24.12.95) - first release
  267. V0.6ß - (3.3.96) - added some enhancements:
  268.  - removing disk while prog executes is now handled properly
  269.  - added waiting for user response before any action is done (security)
  270.  - added OFS switch (but watch out 1.3 freaks!)
  271.  - displays 'cylinder' rather than 'track'
  272.  - fixed minor bug
  273. V0.7ß - (29.5.96) - minor fixes
  274.  - fixed very stupid bug with disk labels longer than 30 chars
  275.  - no longer crashes when attempted to run from WB
  276.  - removed some even more stupid grammar errors in documentation ;)
  277. V0.8ß - (19.4.97) - internal release with added support of floppy.device
  278. V0.9ß - (28.5.97) - root track is now formatted first; this dramatically
  279.    speeds up error detection of unusable disks 
  280. V1.0 - (27.8.97) - third Aminet release and propably the last version:
  281.  - removed special support for floppy.device; use at least version 4.1 of it!
  282.  - fixed serious bug with disks that require more than one bitmap block (f.ex.
  283.    HD disk formatted in floppy.device format). Added check for maximal number
  284.    of blocks per track - it has been set to 32 (seems enough for floppies, 25
  285.    is propably the hardware limit, anyway)
  286.  - added defaults for disk name; if you don't specify it, it'll be labelled
  287.    'WARNING' (if errors occured) or 'Empty' (if disk was good)
  288.  
  289.  
  290. Contact address
  291. ---------------
  292.  
  293. My e-mail address (may be temporary!): bloelle@polbox.com
  294.  
  295. or you can try snail-mail:
  296.  
  297.                               Mikolaj Calusinski
  298.                             ul. Olsztynska 113/117
  299.                               42-200 Czestochowa
  300.                                     POLAND
  301.  
  302.  
  303.  
  304. I hope you find this little proggy useful. Have fun!
  305.                                                             Mike.
  306.  
  307.            ------------> AMIGA - THE BEST COMPUTER EVER <------------
  308.